package dao

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Name string `gorm:"type:varchar(20);not null;comment:名称"`
	Pass string `gorm:"type:varchar(40);not null;comment:密码"`
}

func (User) TableName() string {
	return "user"
}

type TestQuestions struct {
	gorm.Model
	TestQuestionType int    `gorm:"type:tinyint(1);default:1;not null;comment:试题类型:1-单选,2-多选,3-判断"`
	Difficulty       int    `gorm:"type:tinyint(1);default:1;not null;comment:难度:1-高,2-中,3-低"`
	LevelOnce        string `gorm:"type:varchar(20);not null;comment:一级专业范围"`
	LevelTwo         string `gorm:"type:varchar(20);not null;comment:二级专业范围"`
	Author           string `gorm:"type:varchar(20);not null;comment:作者"`
	AuthorId         string `gorm:"type:varchar(20);not null;comment:作者工号"`
	Create           string `gorm:"type:varchar(20);not null;comment:创建人"`
	CreateId         string `gorm:"type:varchar(20);not null;comment:穿管人工号"`
	Reviewer         string `gorm:"type:varchar(20);not null;comment:审核人"`
	ReviewerId       string `gorm:"type:varchar(20);not null;comment:审核人工号"`
	Topic            string `gorm:"type:varchar(20);not null;comment:试题题目"`
	A                string `gorm:"type:varchar(20);not null;comment:A选项"`
	B                string `gorm:"type:varchar(20);not null;comment:B选项"`
	C                string `gorm:"type:varchar(20);not null;comment:C选项"`
	D                string `gorm:"type:varchar(20);not null;comment:D选项"`
	Answer           string `gorm:"type:varchar(20);not null;comment:试题答案"`
	Analysis         string `gorm:"type:varchar(20);not null;comment:解析"`
	Keywords         string `gorm:"type:varchar(20);not null;comment:关键字"`
}

func (TestQuestions) TableName() string {
	return "testQuestions"
}

type TestPaper struct {
	gorm.Model
	ComposingType        int    `gorm:"type:tinyint(1);not null;comment:组卷类型"`
	TestPaperName        string `gorm:"type:varchar(20);not null;comment:试卷名称"`
	TestPaperType        int    `gorm:"type:tinyint(1);not null;comment:试卷类型"`
	ExamDuration         string `gorm:"type:varchar(20);not null;comment:考试时长"`
	SortingQuestionsType int    `gorm:"type:tinyint(1);not null;comment:试题排列顺序类型"`
	SelectionSort        int    `gorm:"type:tinyint(1);not null;comment:选项排列"`
	TotalScore           int    `gorm:"type:varchar(20);not null;comment:总分"`
	PassScore            int    `gorm:"type:varchar(20);not null;comment:及格分数"`
	Reviewer             string `gorm:"type:varchar(20);not null;comment:阅卷人"`
	ExamNotice           string `gorm:"type:varchar(20);not null;comment:考试须知"`
}

func (TestPaper) TableName() string {
	return "testPaper"
}

type ExamDetails struct {
	gorm.Model
	Name         string `gorm:"type:varchar(20);not null;comment:姓名"`
	Score        int    `gorm:"type:int(11);not null;comment:分数"`
	CorrectTopic int    `gorm:"type:int(11);not null;comment:正确题目"`
	ErrorTopic   int    `gorm:"type:int(11);not null;comment:错误题目"`
}

func (ExamDetails) TableName() string {
	return "examDetails"
}

type ExamStatus struct {
	gorm.Model
	ExamId int `gorm:"type:int(11);not null;comment:考试ID"`
	Status int `gorm:"type:tinyint(1);not null;comment:考试状态:1-未开始,2-进行中,3-已结束"`
}

func (ExamStatus) TableName() string {
	return "examStatus"
}
